import { RoomDataItem } from '@/services/cloud';

export function getAnchorStartTime (room: RoomDataItem) {
  if (!room.data.anchor) {
    return 0;
  }

  return room.data.anchor.time + room.data.anchor.current_time;
}

export function getRedPocketStartTime (room: RoomDataItem) {
  if (!room.data.popularity_red_pocket) {
    return 0;
  }
  const firstLottery = room.data.popularity_red_pocket[0];

  if (!firstLottery) {
    return 0;
  }

  return firstLottery.end_time;
}
